<template>
  <div>
    <ul>
      <li>
        <router-link to="/contacts/all_contacts">All contacts</router-link>
        <!-- <a href="">All contacts</a> -->
      </li>
      <li>
        <router-link to="/contacts/alice">Alice</router-link>
        <!-- <a href="">All contacts</a> -->
      </li>
      <li>
        <router-link to="/contacts/bob">Bob</router-link>
        <!-- <a href="">All contacts</a> -->
      </li>
    </ul> 
    <button @click="fn">随机显示</button>
    <router-view></router-view>
  </div>
</template>
 
<script>
export default {
  data() {
    return {};
  },
  methods: {
    fn() {
      const hashs = ['/contacts/all_contacts','/contacts/alice','/contacts/bob']
      const random = Math.floor(Math.random()*3)

      this.$router.push(hashs[random])
    }
  },
  components: {},
};
</script>

<style scoped>
     
</style>